<!DOCTYPE html>
<html class="x-admin-sm" lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改行业分类信息</title>
    <meta content="webkit|ie-comp|ie-stand" name="renderer">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" name="viewport" />
    <link rel="stylesheet" th:href="@{/layui/css/font.css}">
    <link rel="stylesheet" th:href="@{/layui/css/login.css}">
    <link rel="stylesheet" th:href="@{/layui/css/xadmin.css}">
    <script charset="utf-8" th:src="@{/layui/lib/layui/layui.js}"></script>
    <script th:src="@{/layui/js/xadmin.js}" type="text/javascript"></script>
    <style>
        .login {
            margin: 75px auto auto auto;
        }
    </style>
</head>
<body class="login-bg">

<div class="login layui-anim layui-anim-up">
    <div class="message">修改省级信息</div>
    <div id="darkbannerwrap"></div>
    <form class="layui-form" method="post" >
        <div style="display: none">
            <label>
                <input name="id" th:value="${industry.id}">
            </label>
        </div>
        <label>
            <input class="layui-input" lay-verify="required" name="industryName"  placeholder="行业名称" th:value="${industry.industryName}" type="text" >
        </label>
        <hr class="hr15">
        <input lay-filter="edit" lay-submit style="width:100%;" type="submit" value="修改信息">
        <hr class="hr20" >
    </form>
</div>

<script>
    layui.use('form', function(){
        const form = layui.form, $ = layui.$;

        //监听提交
        form.on('submit(edit)', function(data){
            $.ajax({
                url : "/admin_set_industry_message_save_or_edit",
                method : 'post',
                data : data.field,
                dataType : 'JSON',
                success:function(res){
                    if(res.code === 0){
                        //弹出提示，并在1秒后进行跳转
                        layer.alert("修改成功", {
                            icon : 6
                        }, function() {
                            //关闭当前frame
                            xadmin.close();

                            // 可以对父窗口进行刷新
                            xadmin.father_reload();
                            return false;
                        });
                    } else {
                        layer.msg("修改失败:" + res.msg);
                        return false;
                    }
                }
            });
            return false;
        });
    });
</script>
<!-- 底部结束 -->
</body>
</html>